﻿
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web;
using System;
using System.Linq;

namespace ZSoftInstagram.UI.ViewModels
{
    public class PinDeleteModel
    {
        [Required]
        public int Id { get; set; }
    }

    public class PinCreateModel
    {
        [Required]
        public int BoardId { get; set; }
        [Required]
        public string Description { get; set; }
        [Required]
        public HttpPostedFileBase File { get; set; }
        public string RawTags { get; set; }
    }

    public class PinViewModel
    {
        public int Id { get; set; }
        public AddressViewModel Address { get; set; }
        public string Description { get; set; }
        public DateTime Date { get; set; }
    }



    public class PinHomeViewModel
    {
        public int Id { get; set; }
        public string ImageAddress { get; set; }
        public string Description { get; set; }
        public DateTime Date { get; set; }
        public bool AlreadyLiked(int userId)
        {
            return this.LikedUserIds.Any(id => id == userId);
        }
        public IEnumerable<int> LikedUserIds { get; set; }

    }
}
